	<div id="content">
<?php
if( get('ini_ad1') ) echo "			<div class='main'><div class='ad1' style=margin:0>".get('ini_ad1_code')."</div></div>\n";
if( get('ini_cms_new') && !get( 'ini_mark') && function_exists('themedie') ) :
?>
		<div id="new-post" class="main">
<?php
query_posts( "caller_get_posts=1&showposts=1&cat=".get('ini_cat') );
while(have_posts()) : the_post();
?>
			<div class="first-post clear">
				<?php get_img(430,230)?> 
				<h2><a href="<?php the_permalink()?>"><?php the_title()?></a></h2>
				<div class="post-info"><?php if( get('ini_rate') ) fancyratings(); echo '<span><i class="icon-calendar"></i>&nbsp;'; the_category(', '); echo '</span><span><i class="icon-time"></i>&nbsp;<time datetime="'. get_the_time('Y-m-d') .'">'. get_the_time('Y-m-d') .'</time></span><span><i class="icon-eye-open"></i>&nbsp;'.get_post_views($post->ID).' ℃</span>'; echo edit_post_link('编辑文章', '<span><i class="icon-edit"></i>&nbsp;', '</span>')?></div>
				<div class="post-entry"><?php ini_excerpt(320)?></div>
				<?php ini_tags()?> 
			</div>
<?php endwhile?>
			<ul class="new-post-list">
				<?php
$newpost = get('ini_cms_num') ? get('ini_cms_num')-1 : 10;
query_posts( "offset=1&caller_get_posts=1&showposts=$newpost&cat=".get('ini_cat') );
while(have_posts()) :the_post();
echo '<li><span>(' .get_the_time('m-d'). ')</span><a href="' .get_permalink(). '">' .get_the_title(). '</a></li>';
endwhile;
?>
<?php wp_reset_query()?>
			</ul>
		</div>
<?php
endif;
if ( get('ini_cms_sticky') ) { ?>
		<div class="main">
<?php if ( get_option('sticky_posts') && $obj_key== $ini_key ){?>
			<div class="sticky clear">
<?php
$num = get('ini_sticky') ? get('ini_sticky') : 4;
$args = array( 'post__in' => get_option('sticky_posts'), 'showposts' => $num, 'caller_get_posts' => 1 );
query_posts($args);
while ( have_posts() ): the_post();
?>
				<article>
					<h2><?php ini_title(0,1,1)?></h2>
					<div class="post-info"><?php echo '<span><i class="icon-calendar"></i>&nbsp;'; the_category(', '); echo '</span>'; if( get('ini_rate') ) fancyratings(); else echo '<span><i class="icon-time"></i>&nbsp;<time datetime="'. get_the_time('Y-m-d') .'">'. get_the_time('Y-m-d') .' </time></span>'; echo edit_post_link('编辑文章', '<span><i class="icon-edit"></i>&nbsp;', '</span>')?></div>
					<?php echo get_img(86,86)?>
					<section class="post-entry">
						<?php ini_excerpt()?>
						<?php ini_tags()?>
					</section>
				</article>
<?php endwhile; wp_reset_query()?>
			</div><?php#end sticky?>
<?php }?>
		</div>
<?php
}
if( get('ini_cms_tab') &&!get('ini_mark') ):
?>
		<div id="tab-post" class="main">
			<?php
if( get('ini_cms_tab_id') ) {
	$tab_categories = explode(',', get('ini_cms_tab_id') );
	$tab_post_num = get('ini_cms_tab_num') ? get('ini_cms_tab_num') : 4;
	echo '<ul class="tab-post-cate">';
	$i = 0;
	foreach ($tab_categories as $category) {
		$i++;
		query_posts( "showposts=$tab_post_num&cat=$category" );
		echo '<li class="tab-cat-title';
		echo $i == 1 ? ' active' : '';
		echo '"><a href="javascript:;">';
		single_cat_title();
		echo '</a>';
		echo '<a class="href" href="' . get_category_link($category) . '">';
		single_cat_title();
		echo '</a></li>';
	}
	echo '</ul>';
	$i = 0;
	echo '<div class="tab-post-item">';
	foreach ($tab_categories as $category) {
		$i++;
		query_posts( "showposts=$tab_post_num&cat=$category" );
		echo '<ul class="tab-post-list clear';
		echo $i == 1 ? "" : ' hide';
		echo '">';
		while(have_posts()) : the_post();
		echo '<li>';
		echo '<a href="' .get_permalink(). '">' . ini_thumb(220,120,1) . '<span>' . get_the_title() . '</span></a>';
		echo '</li>';
		endwhile;
		echo '</ul>';
	}
	echo '</div>';
	wp_reset_query();
}
?>
		</div>
<?php
endif;
if( get('ini_ad2') ) echo "		<div class='main'><div class='ad2'>".get('ini_ad2_code')."</div></div>\n";
if( ( get('ini_cms_cate') || get('ini_cms_cate2') ) && $ini_key ==$obj_key ) :
?>
		<div class="cat-post">
			<div class="clear">
				<div class="cat-post-left">
<?php
if( get('ini_cms_cate') && get('ini_cms_cate_id') ) {
	$set_categories = explode(',', get('ini_cms_cate_id') );
	$cat_num = get('ini_cms_cate_num') ? get('ini_cms_cate_num') : $cat_num = 6;
	$i = 1;
	foreach ($set_categories as $category){
		if( $i%2 == 1 ) $j_categories = $j_categories . $category.",";
		$i++;
	}
	$categories = substr( $j_categories, 0, strlen($j_categories)-1 );
	$categories = explode( ',', $categories );
	echo category_post( $categories, $cat_num );
}
if( get('ini_cms_cate2') && get('ini_cms_cate2_id') ) {
	$set_categories = explode(',', get('ini_cms_cate2_id') );
	$cat_num = get('ini_cms_cate2_num') ? get('ini_cms_cate2_num') : $cat_num = 6;
	$i = 1;
	foreach ($set_categories as $category){
		if( $i%2 == 1 ) $j_categories2 = $j_categories2 . $category.",";
		$i++;
	}
	$categories = substr( $j_categories2, 0, strlen($j_categories2)-1 );
	$categories = explode( ',', $categories );
	echo category_post( $categories, $cat_num, 0 );
}
?>
				</div>
				<div class="cat-post-right">
<?php
	if( get('ini_cms_cate') && get('ini_cms_cate_id') ) {
	$set_categories = explode(',', get('ini_cms_cate_id') );
	$cat_num = get('ini_cms_cate_num') ? get('ini_cms_cate_num') : $cat_num = 6;
	$i = 1;
	foreach ($set_categories as $category){
		if( $i%2 == 0 ) $o_categories = $o_categories . $category.",";
		$i++;
	}
	$categories = substr( $o_categories, 0, strlen($o_categories)-1 );
	$categories = explode( ',', $categories );
	echo category_post( $categories, $cat_num );
}
	if( get('ini_cms_cate2') && get('ini_cms_cate2_id') ) {
	$set_categories = explode(',', get('ini_cms_cate2_id') );
	$cat_num = get('ini_cms_cate2_num') ? get('ini_cms_cate2_num') : $cat_num = 6;
	$i = 1;
	foreach ($set_categories as $category){
		if( $i%2 == 0 ) $o_categories2 = $o_categories2 . $category.",";
		$i++;
	}
	$categories = substr( $o_categories2, 0, strlen($o_categories2)-1 );
	$categories = explode( ',', $categories );
	echo category_post( $categories, $cat_num, 0 );
}
?>
				</div>
			</div>
		</div>
<?php endif?>
	</div>

<?php
function category_post( $categories, $cat_num, $article = 1 ){
	global $post;
	foreach ( $categories as $category ){
		query_posts( 'showposts=1&cat='.$category )?>
					<div class="cat-post-item bd">
						<div class="cat-title"><a href="<?php echo get_category_link($category)?>"><?php single_cat_title()?></a></div>
						<div class="cat-post-list">
<?php query_posts( 'showposts='.$cat_num.'&cat='.$category )?>
							<ul <?php if( $article == 1 ) echo 'class="posts"'?>>
<?php while (have_posts()) : the_post()?>
<?php if( $article == 1 ) : ?>
								<li><?php ini_img(48,48)?><a class="post-title" href="<?php the_permalink()?>"><?php the_title()?></a><small class="info"><i class="icon-time"></i><?php the_time('Y/m/d')?><i class="icon-eye-open"></i><?php echo get_post_views($post->ID)?></small></li>
<?php else : ?>
								<li><time><?php the_time('m/d')?></time><a class="post-title" href="<?php the_permalink()?>"><?php the_title()?></a></li>
<?php endif?>
<?php endwhile?>
<?php wp_reset_query()?>
							</ul>
						</div>
					</div>
<?php }
}